var videoIsCover=true;
var videoCoverHtml;
var videoContentHtml;
function videoHome(divid){
	videoCoverHtml = $("#"+divid).html();
	self.setInterval("getVideoContentHtml()",10000);
	self.setInterval("showVideoContent('"+divid+"')",15000);
}

function showVideoContent(divid){
	
	if(videoContentHtml==null||videoContentHtml==""){
		return;		
	}
	if(videoIsCover){
		$("#"+divid).empty();
		$("#"+divid).append(videoContentHtml);
		$("#"+divid).find(".video1").fadeIn(1000);
		videoIsCover = false;
	}else{
		$("#"+divid).find(".video1").fadeOut(1000,function(){
			$("#"+divid).empty();
			$("#"+divid).append(videoCoverHtml);
			videoIsCover = true;
		});
		
	}
	refreash();
}

function getVideoContentHtml(){
	$.getJSON("video_getHotVideo.do",{num:1,type:5},function(json){
		if(json!=null&&json[0]!=null){
			var name = json[0].tv_name;
			var year = json[0].tv_year;
			var director = json[0].director;
			if(name==''||name==null){
				name = '暂无';
			}
			if(year==''||year==null){
				year = '暂无';
			}
			if(director==''||director==null){
				director = '暂无';
			}
			videoContentHtml = '<div class="video1" style="width:100%;float:left;display:none;height:100%;text-align:left;" ><div style="padding-left:5%;padding-top:7%;float:left;width:30%;height:80%;"><img id="'+json[0].id+'" src="'+json[0].tv_big_pic+'" style="width:90%;height:90%;cursor:pointer;border:#f8f7f0 2px solid;"/></div><div  style="float:left;padding-left:3%;padding-top:10%;width:60%;height:80%;" ><div style="padding-top:5px;" class="covertext2">'+name+'</div><div style="padding-top:5px;" class="covertext2">'+"年份："+year+'</div><div style="padding-top:5px;" class="covertext2">'+"导演："+director+'</div></div></div>';
		}
		
	});
}